import axios from "axios"

const aa = axios.create({
    baseURL: "", //基础路由
    timeout: 5000 //超时时间
})


//定义一个 请求拦截器
aa.interceptors.request.use((config) => {


    var ss = sessionStorage.getItem('token')

    config.headers.Authorization = ss
    return config
}), (error) => {
    return Promise.reject(error)
}

//定义一个回应
aa.interceptors.response.use((response) => {
    // console.log(response)

    if (response.status == 200) {
        return response.data
    }

}), (error) => {
    return Promise.reject(erron)
}

export default aa
